package com.niodata.dp.monitor.base;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;

@SpringBootApplication
@EnableAutoConfiguration(exclude = {MongoAutoConfiguration.class,
      FreeMarkerAutoConfiguration.class})
@ComponentScan({"com.niodata.dp.monitor", "com.niodata.dp.core", "com.niodata.dt.*"})
@MapperScan({"com.niodata.dp.monitor", "com.niodata.dp.core", "com.niodata.dt.*"})
@PropertySources(
      value = {
            @PropertySource("classpath:application.properties"),
            @PropertySource("classpath:datasource.properties")
      }
)
public class MonitorApp {

  public static void main(String[] args) {
    System.setProperty("HADOOP_USER_NAME", "metrics");
    new SpringApplicationBuilder(MonitorApp.class).run(args);
  }
}
